package com.ruge.common.config;

import com.ruge.common.util.ShiroUtil;
import org.springframework.data.domain.AuditorAware;
import org.springframework.stereotype.Component;

import java.util.Optional;

/**
 * @author ruge.wu
 * @program ruge
 * @description jpa 开启审计功能
 * @date 2020-03-13 10:08
 **/
@Component
public class AuditorAwareImpl implements AuditorAware<String> {
    @Override
    public Optional<String> getCurrentAuditor() {
      //  return Optional.of(ShiroUtil.getActiveUser().getUser().getLoginName());
        return Optional.of("123");
    }
}
